class Demo:
    def __init__(self, func):
        self.func = func
        self.__name__ = func.__name__
        self.__doc__ = func.__doc__
        print("init方法中接收到的func:", func)

    def __call__(self, *args, **kwargs):
        print("-----装饰器扩展的代码-------start")
        self.func()
        print("-----装饰器扩展的代码-------end")


@Demo
def func():
    """注释"""
    print("-----func----")


if __name__ == '__main__':
    func()
    print(func.__doc__)
    print(func.__name__)
